package com.csi.bumblebee.service.impl;

import com.csi.bumblebee.domain.dictionary.MyLocation;
import com.csi.bumblebee.mapper.MyLocationMapper;
import com.csi.bumblebee.service.MyLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class MyLocationServiceImpl implements MyLocationService {

    @Autowired
    private MyLocationMapper myLocationMapper;

    /**
     * 查询一级城市分类
     * @return 一级城市分类集合
     */
    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
    public List<MyLocation> listLocationOne() {
        return this.myLocationMapper.listLocationOne();
    }

    /**
     * 查询二级城市分类
     * @return 一级城市分类集合
     */
    @Override
    public List<MyLocation> listLocationTwo() {
        return this.myLocationMapper.listLocationTwo();
    }


    /**
     * 查询一级城市分类下的二级城区分类
     * @return 二级城市分类集合
     */
    @Override
    public List<MyLocation> listLocationSon(String id) {
        return this.myLocationMapper.listLocationSon(id);
    }

    /**
     * 查询全部地理位置
     * @return MyLocation集合
     */
    @Override
    public List<MyLocation> listLocationTree() {
        return myLocationMapper.listLocationTree();
    }


}
